﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Web;
using DHQGHN.DAL;
using DHQGHN.DAL.Models.DanhMuc;

namespace DHQGHN.Services.DanhMuc
{
    [ServiceContract]
    public interface IAddressService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAll"
            )]
        IEnumerable<DAL.Models.DanhMuc.ADDRESS> GetAll();
        /// <summary>
        /// gopro, 20150508: get dia chi theo ma dia ban dieu tra
        /// </summary>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByAreaCode/{areaCode}"
            )]
        IEnumerable<DAL.Models.DanhMuc.ADDRESS> GetByAreaCode(string areaCode);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIdx"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllPaging/{pageSize}/{pageIdx}"
            )]
        IEnumerable<DAL.Models.DanhMuc.ADDRESS> GetAllPaging(string pageSize, string pageIdx);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByID/{addressID}"
            )]
        DAL.Models.DanhMuc.ADDRESS GetByID(string addressID);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="address"></param>
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "AddAddress")]
        void AddAddress(DAL.Models.DanhMuc.ADDRESS address);

       
        /// <summary>
        /// 
        /// </summary>
        /// <param name="addressID"></param>
        [OperationContract]
        [WebInvoke(Method = "DELETE",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "DeleteAddress")]
        void DeleteAddress(string addressID);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="address"></param>
        [OperationContract]
        [WebInvoke(Method = "PUT",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "EditAddress")]
        void EditAddress(DAL.Models.DanhMuc.ADDRESS address);

        /// <summary>
        /// datlq, 20150619, lay bang adminCode
        /// </summary>
        /// <param name="areaCode"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetByAdminCode/{adminCode}"
            )]
        IEnumerable<DAL.Models.DanhMuc.ADDRESS> GetByAdminCode(string adminCode);
    }
}